package com.thesis.client;



import android.app.ActionBar;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class StatisticActivity extends TabActivity {

	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_statistic);
		ActionBar ab = getActionBar();
		ab.setTitle(getResources().getString(R.string.title_activity_statistic));
		ab.setDisplayHomeAsUpEnabled(true);
		
		Resources ressources = getResources(); 
		TabHost tabHost = getTabHost();
		
		Intent intentRevenue = new Intent().setClass(this, RevenueActivity.class);
		TabSpec tabRevenue = tabHost
			.newTabSpec("Doanhthu")
			.setIndicator("Doanh thu")
			.setContent(intentRevenue);
		
		Intent intentBill = new Intent().setClass(this,BillActivity.class);
		TabSpec tabBill = tabHost
			.newTabSpec("Hoadon")
			.setIndicator("Hóa đơn")
			.setContent(intentBill);
		
		Intent intentFood = new Intent().setClass(this,FoodStatisticActivity.class);
		TabSpec tabFood = tabHost
			.newTabSpec("Monan")
			.setIndicator("Món ăn")
			.setContent(intentFood);
		
		
		tabHost.addTab(tabRevenue);
		tabHost.addTab(tabBill);
		tabHost.addTab(tabFood);
		
		tabHost.setCurrentTab(2);
		
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			finish();
			return true;
		default:
			return super.onOptionsItemSelected(item);
		}
	}
	

}
